<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:a="livcos.org/ns/admin"
	xmlns="http://www.w3.org/1999/xhtml"
	exclude-result-prefixes="a">
	
	<xsl:import href="../base.xsl" />

	<xsl:template match="a:address">
		<div id="{@id}" class="address">
		  <p><xsl:value-of select="a:street" />&#160;<xsl:value-of select="a:house" /></p>
      <p>
        <xsl:value-of select="a:country"/>
        <xsl:text>-</xsl:text>
        <xsl:value-of select="a:zipCode"/>&#160;<xsl:value-of select="a:city"/>
      </p>
		</div>
	</xsl:template>
	
	<xsl:template match="a:address[@ref]">
	  <xsl:apply-templates select="/*/*/a:address[@id = current()/@ref]" />
	</xsl:template>
	
	<xsl:template match="a:phone">
		<span id="{@id}" class="phone">
		  <img src="{$toDomainPath}/web/img/phone.png" height="14pt"/>
			<xsl:text> +</xsl:text>
			<xsl:value-of select="@country" />
			<xsl:text> (0</xsl:text>
			<xsl:value-of select="@area" />
			<xsl:text>) </xsl:text>
			<xsl:value-of select="substring(@number,1,3)" />
		  <xsl:text>&#160;</xsl:text>
		  <xsl:value-of select="substring(@number,4)" />
		</span>
	</xsl:template>
	
	<xsl:template match="a:email">
		<span id="{@id}" class="email">
		  <a href="">
		    <xsl:attribute name="onclick">
		      <xsl:text>this.href='ma'+'ilto:'+'</xsl:text>
		      <xsl:value-of select="@name" />
		      <xsl:text>'+''+'@'+'</xsl:text>
		      <xsl:value-of select="@domain" />
		      <xsl:text>'+''</xsl:text>
		    </xsl:attribute>
		    <img src="{$toDomainPath}/web/img/mail.png"/>
		    <xsl:text>&#160;</xsl:text>
		    <xsl:value-of select="@name" />
		    <span style="display:none">abc</span>
		    <xsl:text>@</xsl:text>
		    <span></span>
		    <span style="display:none">abc</span>
		    <xsl:value-of select="@domain" />
		  </a>
		</span>
	</xsl:template>
	
</xsl:stylesheet>
